From: Brion Vibber Date: Thu, 19 Feb 2004 06:40:52 +0000 (+0000) Subject: Make sure that id taken from cookie is an int; otherwise it goes to 0 X-Git-Tag: 1.3.0beta1~974 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=029d76d20992144ce435f05d364b8f0f6500a4cc;p=lhc%2Fweb%2Fwiklou.git Make sure that id taken from cookie is an int; otherwise it goes to 0 --- diff --git a/includes/User.php b/includes/User.php index b3e5d98fb4..7a21052abf 100644 --- a/includes/User.php +++ b/includes/User.php @@ -163,7 +163,7 @@ class User { return new User(); } } else if ( isset( $HTTP_COOKIE_VARS["{$wgDBname}UserID"] ) ) { - $sId = $HTTP_COOKIE_VARS["{$wgDBname}UserID"]; + $sId = IntVal( $HTTP_COOKIE_VARS["{$wgDBname}UserID"] ); $wsUserID = $sId; } else { return new User(); @@ -214,6 +214,10 @@ class User { function loadFromDatabase() { if ( $this->mDataLoaded ) { return; } + + # Paranoia + $this->mId = IntVal( $this->mId ); + # check in separate table if there are changes to the talk page $this->mNewtalk=0; # reset talk page status if($this->mId) {